﻿namespace 事件驱动;

public interface Callback {
}

@FunctionalInterface
interface NoArgsCallback extends Callback {
    void call();
}

@FunctionalInterface
interface ArgsCallback extends Callback {
    void call(Object[] objects);
}


class Test {
    public void method(Callback callback) {
        if (callback instanceof NoArgsCallback noArgsCallback) {
            noArgsCallback.call();
        }
    }

    public static void main(String[] args) {
        ArgsCallback a = afff -> {
            System.out.println("Ffff");
        };
        new Test().method(a);
    }
 这种c# 怎么写
